#include <unistd.h>
#include <sys/socket.h>

#include "executor.hpp"

namespace asyncio {
    struct IoResult {
        int events;
    };

    int accept_async(coro::Context<IoResult> &ctx,
                     int sockfd, struct sockaddr *addr, socklen_t * addrlen);
    int connect_async(coro::Context<IoResult> &ctx,
                      int sockfd, const struct sockaddr *addr, socklen_t addrlen);
    ssize_t read_async(coro::Context<IoResult> &ctx,
                       int fd, void *buf, size_t count);
    ssize_t write_async(coro::Context<IoResult> &ctx,
                        int fd, const void *buf, size_t count);
};
